package model;

public class CountableGoods extends UncountableGoods {

	/**
	 * @uml.property name="stock"
	 */
	private int stock;

	/**
	 * Getter of the property <tt>stock</tt>
	 * 
	 * @return Returns the stock.
	 * @uml.property name="stock"
	 */

	public CountableGoods(String label) {
		this(label, 0, 0);
	}

	public CountableGoods(String label, int cost, int stock) {
		super(label, cost);
		this.stock = stock > 0 ? stock : 0;
	}

	public int getStock() {
		return stock;
	}

	/**
	 * Setter of the property <tt>stock</tt>
	 * 
	 * @param stock
	 *            The stock to set.
	 * @uml.property name="stock"
	 */
	public boolean setStock(int stock0) {
		if (stock0 < 0)
			return false;
		this.stock = stock0;
		return true;
	}

	/**
		 */
	public void addStock(int freshfurniture){
		if( freshfurniture > 0)
		this.stock += freshfurniture;

	}

}
